<?php

require_once 'database/User.php';
require_once 'database/DatabaseConnection.php';
require_once 'command/GetUserCommand.php';

class UserTest {
	
	private $name = 'MV';
	private $password = 'hello';
	private $user;
	
	public function __construct(){
		$this->user = new User();
	}
	
	/**
	 * Tests the user select function
	 */
	public function testReadUser(){
		$bool = false;
		DatabaseConnection::connect();
		$arrObj = $arrObj = $this->user->readUser($this->name, $this->password);
		if(is_object($arrObj)){
			$bool = true;
		}
		DatabaseConnection::disconnect();
		return $bool;
	}
	
	/**
	 * Tests 
	 */
	public function testGetUserCommand(){
		$getUserCommand = new GetUserCommand($this->name, $this->password);
		echo $getUserCommand->execute();
	}
	
}